package Runde2;

import java.util.ArrayList;
import java.util.GregorianCalendar;


public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		System.out.println("---- Person bezogene Tests: ----\n");
		//Die matrNr hier koennen fuer weitere Tests benutzt werden.
		String matrNr1 = createStud("Peter", "Rauschberger", "info123", "0912127");
		String matrNr2 = createStud("Wolfgang", "Winter", "geheim", "1011331");
		createStud("Judith","Schwarzer","sowieso","10141a1"); //matrNr besteht nicht nur aus Ziffern
		createStud("Hans", "Glockner", "gameofthronesfan", "101233"); //matrNr zu kurz
		createStud("Angelika", "Muellner", "leiw4nd", "08210132"); //matNr zu lang
		System.out.println("\nGebe Liste von (korrekt) erstellten Studenten aus: \n");
		System.out.print(StudentManager.getStudentList() + "\n");
		//Die profNr hier koennen fuer weitere Tests benutzt werden.
		int profNr1 = createProf("Herbert","Schmitt","super1");
		int profNr2 = createProf("Brigitte","Filz","zufall");
		createProf("","Steiner","pw1");
		createProf("Gerald","","pw2");
		System.out.println("\nGebe Liste von (korrekt) erstellten Professoren aus: \n");
		System.out.print(ProfessorManager.getProfessorList() + "\n");
		

		System.out.println("---- LVA bezogene Tests: ----\n");

		
		int lva1 = createUE(1, "Multimedia WS11", ProfessorManager.getProf(profNr1), new GregorianCalendar(2011,8,10,12,0), new GregorianCalendar(2011,9,29,12,0), new GregorianCalendar(2011,9,1,15,0), 1, new ArrayList<Integer>(), new int[]{}); //deReg before latestReg
		lva1 = createUE(1, "Multimedia WS11", ProfessorManager.getProf(profNr1), new GregorianCalendar(2011,8,10,12,0), new GregorianCalendar(2011,9,29,12,0), new GregorianCalendar(2011,10,1,15,0), 1,new ArrayList<Integer>(), new int[]{});

		int lva2 = createVO(2, "Algorithmen und Datenstrukturen 2 WS11", ProfessorManager.getProf(profNr2), new GregorianCalendar(2011,9,3,0,0), new GregorianCalendar(2011,9,2,12,0), new GregorianCalendar(2011,10,7,19,0), Integer.MAX_VALUE,new ArrayList<Integer>(), new int[]{}); //latestReg before earliestReg
		lva2 = createVO(2, "Algorithmen und Datenstrukturen 2 WS11", ProfessorManager.getProf(profNr2), new GregorianCalendar(2011,9,3,0,0), new GregorianCalendar(2011,9,22,12,0), new GregorianCalendar(2011,10,7,19,0), Integer.MAX_VALUE,new ArrayList<Integer>(), new int[]{});
		
		ArrayList<Integer> lva4pre = new ArrayList<Integer>();
		lva4pre.add(2);
		int lva4 = createVO(4, "Algorithmen und Datenstrukturen 2 SS12", ProfessorManager.getProf(profNr2), new GregorianCalendar(2011,9,3,0,0), new GregorianCalendar(2012,5,22,12,0), new GregorianCalendar(2012,10,6,22,0), Integer.MAX_VALUE,lva4pre, new int[]{});
		
		int lva3 = createVU(3, "Objektorientierte Programmiertechniken WS11", ProfessorManager.getProf(profNr1), new GregorianCalendar(2011,8,14,11,0), new GregorianCalendar(2011,10,5,18,0), new GregorianCalendar(2011,10,6,18,0), Integer.MAX_VALUE,new ArrayList<Integer>(), new int[]{1});
		

		System.out.println();
		registerUE(lva1, matrNr2, new GregorianCalendar(2011,8,29,10,0), "geheim");
		registerUE(lva1, matrNr1, new GregorianCalendar(2011,9,1,10,0), "info123"); //LVA full
		changeUEMaxMembers(lva1, 1337, "super1");
		registerUE(lva1, matrNr1, new GregorianCalendar(2011,9,1,10,0), "info123");
		deregisterUE(lva1, matrNr2, new GregorianCalendar(2011,10,1,16,0), "geheim"); //afterDereg
		registerVO(lva2, matrNr2, new GregorianCalendar(2011,9,29,17,0), "geheim"); //after latestReg
		
		System.out.println();
		System.out.println();
		registerVO(2, matrNr2, new GregorianCalendar(2011,9,12,12,0), "geheim");
		createExamVO("zufall", ProfessorManager.getProf(profNr2), new GregorianCalendar(2011,11,12,23,59), 2, 15);
		addParticipantVO(2, new GregorianCalendar(2011,11,12,23,59), "geheim", matrNr2);
		createExamVO("zufall", ProfessorManager.getProf(profNr2), new GregorianCalendar(2011,11,13,23,59), 2, 15);
		addParticipantVO(2,  new GregorianCalendar(2011,11,13,23,59), "geheim", matrNr2);
		createExamVO("zufall", ProfessorManager.getProf(profNr2), new GregorianCalendar(2011,11,14,23,59), 2, 15);
		addParticipantVO(2, new GregorianCalendar(2011,11,14,23,59), "geheim", matrNr2);
		setGradeExam(2, new GregorianCalendar(2011,11,12,23,59), matrNr2, 5, "zufall");
		setGradeExam(2, new GregorianCalendar(2011,11,13,23,59), matrNr2, 4, "zufall");
		setGradeExam(2, new GregorianCalendar(2011,11,14,23,59), matrNr2, 5, "zufall");
		System.out.println();
		System.out.println("Student #" + matrNr2 + " hat nun 3x die Pruefung/Wasauchimmer gemacht, er fliegt damit aus der LVA raus.");
		System.out.println();
		createExamVO("zufall", ProfessorManager.getProf(profNr2), new GregorianCalendar(2011,11,15,23,59), 2, 15);
		addParticipantVO(2, new GregorianCalendar(2011,11,15,23,59), "geheim", matrNr2); //too many tries part 1 (student gets kicked out)
		registerVO(lva2, matrNr2, new GregorianCalendar(2011,9,12,12,0), "geheim"); //too many tries part 2
		registerVO(lva4, matrNr2, new GregorianCalendar(2011,9,12,12,0), "geheim"); //too many tries part 3 (successor)
		System.out.println();
		System.out.println();
		
		System.out.println("LVA #" + lva3 + " setzt LVA #1 voraus");
		addTutor(1, "super1", ProfessorManager.getProf(profNr1));
		int grpIndex = addGroup(1, 15, "super1", ProfessorManager.getProf(profNr1));
		addParticipantUE(1, grpIndex, "info123", matrNr1);
		setGradeGroup(1, grpIndex, matrNr1, 2, "super1");
		registerVU(lva3, matrNr2 ,new GregorianCalendar(2011,8,14,12,0), "geheim"); //doesn't meet requirements
		registerVU(lva3, matrNr1 ,new GregorianCalendar(2011,8,14,12,5), "info123");
		System.out.println();
		
		changeVUTitle(lva3, "Computergrafik 1", "zufall"); //wrong password
		changeVUMaxMembers(lva3, 50, "super1");
		System.out.print(getNewMessages(matrNr1,"info124")); //falsches passwort
		System.out.print(getNewMessages(matrNr1,"info123")); //neue nachrichten
		System.out.print(getNewMessages(matrNr1,"info123")); //keine neuen nachrichten
		System.out.println();
		
		System.out.println(LVAManager.output());
		System.out.println("");
		System.out.println("LVAs werden (mit Passwort des Owners) untot...");
		System.out.println("");
		kill(lva3, "zufall"); //falsches pw
		kill(lva4, "zufall");
		System.out.println(LVAManager.output());
		System.out.println("");
		System.out.println("... lassen nicht mit sich interagieren ...");
		registerVO(lva4, matrNr2, new GregorianCalendar(2011,9,3,0,0), "geheim");
		System.out.println("");
		System.out.println("...und stehen wieder auf! (natuerlich auch nur mit Passwort des Owners.)");
		System.out.println("");
		revive(lva4, "asdf");
		revive(lva4, "zufall");
		System.out.println(LVAManager.output());
		
		
		
		try {
			System.out.println("Erstelle woechentlichen Termin mit falschen owner-Passwort: ");
			getVU(lva3).createWeeklyAppointments(new GregorianCalendar(2011,10,7,15,0), new GregorianCalendar(2011,12,16,15,0), 2, "s1");
		} catch (InsufficientPermissionsException e) {
			System.out.println("\t"+e);
		}
		try {
			System.out.print("Erstelle woechentlichen Termin mit korrektem owner-Passwort:");
			getVU(lva3).createWeeklyAppointments(new GregorianCalendar(2011,10,7,15,0), new GregorianCalendar(2011,12,16,15,0), 2, "super1");
			System.out.print(" ... [passt]");
		} catch (InsufficientPermissionsException e) {
			System.out.println(e.getMessage());
		}
		
		
		System.out.println("\nGebe Liste von erstellten LVA Terminen aus: \n");
		System.out.println(getVU(lva3).getAppointments());
		System.out.println();

		createExamVO("zufaII", ProfessorManager.getProf(profNr2), new GregorianCalendar(2011,12,31,23,59), 2, 1); //falsches pw.
		createExamVO("zufall", ProfessorManager.getProf(profNr2), new GregorianCalendar(2011,12,31,23,59), 2, 1);
		createExamVU("super8", ProfessorManager.getProf(profNr1), new GregorianCalendar(2011,12,31,23,59), 3, 1); //und wieder.
		createExamVU("super1", ProfessorManager.getProf(profNr1), new GregorianCalendar(2011,12,31,23,59), 3, 1);
		System.out.println();
		
		registerVO(lva2, matrNr1, new GregorianCalendar(2011,9,12,12,0), "info123");
		addParticipantVO(2, new GregorianCalendar(2011,12,31,23,58), "info123", matrNr1); //pruefung gibt es nicht
		addParticipantVO(2, new GregorianCalendar(2011,12,31,23,59), "info122", matrNr1); //falsches studenten-pw.
		addParticipantVO(2, new GregorianCalendar(2011,12,31,23,59), "info123", matrNr1);
		setGradeExam(2, new GregorianCalendar(2011,12,31,23,59), "0912127", 5, "asdf"); // falsches pw
		setGradeExam(2, new GregorianCalendar(2011,12,31,23,59), "0912128", 5, "zufall"); //student macht nicht bei der pruefung mit
		setGradeExam(2, new GregorianCalendar(2011,12,31,23,59), "0912127", 6, "zufall"); //ungueltige Note
		setGradeExam(2, new GregorianCalendar(2011,12,31,23,59), "0912127", 5, "zufall");
		System.out.println();
		
		addTutor(1, "super8", StudentManager.getStud(matrNr1)); //falsches pw
		addTutor(1, "super1", StudentManager.getStud("0312128")); //nicht existierende person
		addTutor(1, "super1", StudentManager.getStud(matrNr1));
		
		addGroup(1, 10, "super1", StudentManager.getStud(matrNr2)); //kein Tutor
		addGroup(1, 10, "super1", StudentManager.getStud(matrNr1));
		System.out.println();
		
	}
	
	
	//HIER FOLGEN DIVERSE METHODEN, DIE NICHTS ANDERES ALS DEREN GLEICHNAMIG METHODEN IN DEN EIGENTLICHEN KLASSEN TUN,
	//NUR, DASS DIESE PASSENDEN OUTPUT GEBEN UND SICH UM GEWORFENEN EXCEPTIONS KUEMMERN
	
	public static String createStud(String fName, String lName, String password, String matrNr) {
		try {
			System.out.print("Erstelle Student (" + fName + ", " + lName + ", " + password + ", " + matrNr + "): ...");
			String matrNrTemp = StudentManager.createStud(fName, lName, password, matrNr);
			System.out.print(" [erfolg]\n");
			return matrNrTemp;
		} catch (InvalidPersonException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
			return null;
		}
		
	}
	
	public static int createProf(String fName, String lName, String password){
		try {
			System.out.print("Erstelle Professor (" + fName + ", " + lName + ", " + password + "): ...");
			int profNrTemp = ProfessorManager.createProf(fName, lName, password);
			System.out.print(" [erfolg]\n");
			return profNrTemp;
		} catch (InvalidPersonException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
			return -1;
		}
	}
	
	public static String getNewMessages(String matrNr, String password) {
		try {
			System.out.print("Hole ungelesene Nachrichten von Student " + matrNr + ": ...");
			String messages = StudentManager.getStud(matrNr).getNewMessages(password);
			System.out.print(" [erfolg]\n");
			return messages;
		} catch (InsufficientPermissionsException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
			return "";
		}
		
	}
	
	public static int createUE(int lvaNr, String title, Professor owner, GregorianCalendar earliestReg, GregorianCalendar latestReg, GregorianCalendar deReg, int maxMembers,  ArrayList<Integer> predecessors, int[] requirements) {
		try {
			System.out.print("Erstelle UE ("+lvaNr+", "+title+", "+owner+", "+earliestReg.getTime()+", "+latestReg.getTime()+", "+deReg.getTime()+", "+maxMembers+", "+predecessors+", "+requirements+"): ...");
			int lva = LVAManager.createUE(lvaNr, title, owner, earliestReg, latestReg, deReg, maxMembers, predecessors, requirements);
			System.out.print(" [erfolg]\n");
			return lva;
		} catch (InvalidLVAException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
			return -1;
		}
	}
	
	public static int createVO(int lvaNr, String title, Professor owner, GregorianCalendar earliestReg, GregorianCalendar latestReg, GregorianCalendar deReg, int maxMembers,  ArrayList<Integer> predecessors, int[] requirements) {
		try {
			System.out.print("Erstelle VO ("+lvaNr+", "+title+", "+owner+", "+earliestReg.getTime()+", "+latestReg.getTime()+", "+deReg.getTime()+", "+maxMembers+", "+predecessors+", "+requirements+"): ...");
			int lva = LVAManager.createVO(lvaNr, title, owner, earliestReg, latestReg, deReg, maxMembers, predecessors, requirements);
			System.out.print(" [erfolg]\n");
			return lva;
		} catch (InvalidLVAException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
			return -1;
		}
	}
	
	public static int createVU(int lvaNr, String title, Professor owner, GregorianCalendar earliestReg, GregorianCalendar latestReg, GregorianCalendar deReg, int maxMembers,  ArrayList<Integer> predecessors, int[] requirements) {
		try {
			System.out.print("Erstelle VU ("+lvaNr+", "+title+", "+owner+", "+earliestReg.getTime()+", "+latestReg.getTime()+", "+deReg.getTime()+", "+maxMembers+", "+predecessors+", "+requirements+"): ...");
			int lva = LVAManager.createVU(lvaNr, title, owner, earliestReg, latestReg, deReg, maxMembers, predecessors, requirements);
			System.out.print(" [erfolg]\n");
			return lva;
		} catch (InvalidLVAException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
			return -1;
		}
	}
	
	public static UE getUE(int lvaNr) {
		try {
			UE temp = LVAManager.getUE(lvaNr);
			return temp;	
		} catch (InvalidLVAException e) {
			System.out.print(e + "\n");
			return null;
		}
	}
	
	public static VO getVO(int lvaNr) {
		try {
			VO temp = LVAManager.getVO(lvaNr);
			return temp;
		} catch (InvalidLVAException e) {
			System.out.print(e + "\n");
			return null;
		}
	}
	
	public static VU getVU(int lvaNr) {
		try {
			VU temp = LVAManager.getVU(lvaNr);
			return temp;
		} catch (InvalidLVAException e) {
			System.out.print(e + "\n");
			return null;
		}
	}
	
	public static void registerUE(int lvaNr, String matrNr, GregorianCalendar d, String pw) {
		try  {
			System.out.print("Melde Student ("+matrNr+") zu UE ("+LVAManager.getLVA(lvaNr).getTitle()+") an: ...");
			getUE(lvaNr).register(matrNr, d, pw);
			System.out.print(" [erfolg]\n");
		} catch (CorruptDeRegistrationException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		} catch (InsufficientPermissionsException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		} catch (InvalidLVAException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
		
	}
	public static void registerVO(int lvaNr, String matrNr, GregorianCalendar d, String pw) {
		try  {
			System.out.print("Melde Student ("+matrNr+") zu VO ("+LVAManager.getLVA(lvaNr).getTitle()+") an: ...");
			getVO(lvaNr).register(matrNr, d, pw);
			System.out.print(" [erfolg]\n");
		} catch (CorruptDeRegistrationException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}  catch (InsufficientPermissionsException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		} catch (InvalidLVAException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
		
	}
	public static void registerVU(int lvaNr, String matrNr, GregorianCalendar d, String pw) {
		try  {
			System.out.print("Melde Student ("+matrNr+") zu VU ("+LVAManager.getLVA(lvaNr).getTitle()+") an: ...");
			getVU(lvaNr).register(matrNr, d, pw);
			System.out.print(" [erfolg]\n");
		} catch (CorruptDeRegistrationException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}  catch (InsufficientPermissionsException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		} catch (InvalidLVAException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
		
	}
	
	public static void deregisterUE(int lvaNr, String matrNr, GregorianCalendar d, String pw) {
		try  {
			System.out.print("Melde Student ("+matrNr+") von UE ("+LVAManager.getLVA(lvaNr).getTitle()+") ab: ...");
			getUE(lvaNr).deregister(matrNr, d, pw);
			System.out.print(" [erfolg]\n");
		} catch (CorruptDeRegistrationException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}  catch (InsufficientPermissionsException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
		
	}
	
	public static void changeVUTitle(int lvaNr, String t, String password) {
		try  {
			System.out.print("Aendere VU ("+lvaNr+", "+t+", "+password+"): ...");
			getVU(lvaNr).changeTitle(t, password);
			System.out.print(" [erfolg]\n");
		} catch (Exception e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
	}
	
	public static void changeVUMaxMembers(int lvaNr, int m, String password) {
		try  {
			System.out.print("Aendere VU ("+lvaNr+", "+m+", "+password+"): ...");
			getVU(lvaNr).changeMaxMembers(m, password);
			System.out.print(" [erfolg]\n");
		} catch (Exception e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
	}
	
	public static void changeUEMaxMembers(int lvaNr, int m, String password) {
		try  {
			System.out.print("Aendere UE ("+lvaNr+", "+m+", "+password+"): ...");
			getUE(lvaNr).changeMaxMembers(m, password);
			System.out.print(" [erfolg]\n");
		} catch (Exception e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
	}
	
	public static void createExamVO(String pw, Person examiner, GregorianCalendar date, int lva, int max) {
		try {
			System.out.print("Erstelle Pruefung in VO (" + pw + ", " + examiner + ", " + date.getTime() + ", " + lva + ", " + max + "): ...");
			getVO(lva).createExam(pw, examiner, date, lva, max);
			System.out.print(" [erfolg]\n");
		} catch (InsufficientPermissionsException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
	}
	
	public static void createExamVU(String pw, Person examiner, GregorianCalendar date, int lva, int max) {
		try {
			System.out.print("Erstelle Pruefung in VU (" + pw + ", " + examiner + ", " + date.getTime() + ", " + lva + ", " + max + "): ...");
			getVU(lva).createExam(pw, examiner, date, lva, max);
			System.out.print(" [erfolg]\n");
		} catch (InsufficientPermissionsException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
	}
	
	
	public static void addParticipantVO(int lva, GregorianCalendar date, String pw, String matrNr) {
		try {
			System.out.print("Fuege Pruefungsteilnehmer hinzu ( " + pw + ", " + matrNr + "): ...");
			getVO(lva).getExam(date).addParticipant(pw, matrNr);
			System.out.print(" [erfolg]\n");
		} catch (InsufficientPermissionsException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		} catch (IncorrectDateException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
	}
	
	public static void setGradeExam(int lva, GregorianCalendar date, String matrNr, int grade, String pw) {
		try {
			System.out.print("Setze Note ( " + lva + ", " + date.getTime() + ", " + matrNr + ", " + grade + ", " + pw + "): ...");
			getVO(lva).getExam(date).setGrade(matrNr, grade, pw);
			System.out.print(" [erfolg]\n");
		} catch (InsufficientPermissionsException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		} catch (IncorrectDateException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		} catch (InvalidGradeException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
	}
	
	public static void addTutor(int lva, String pw, Person p) {
		try {
			System.out.print("Fuege Tutor hinzu ( " + lva + ", " + pw + ", " + p + "): ...");
			getUE(lva).addTutor(pw, p);
			System.out.print(" [erfolg]\n");
		} catch (InsufficientPermissionsException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
	}
	
	public static int addGroup(int lva, int maxMembers, String pw, Person p) {
		try {
			System.out.print("Fuege Gruppe hinzu ( " + lva + ", " + pw + ", " + p + "): ...");
			int grpIndex = getUE(lva).addGroup(pw, p, maxMembers);
			System.out.print(" [erfolg]\n");
			return grpIndex;
		} catch (InsufficientPermissionsException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
			return -1;
		}
	}
	
	public static void addParticipantUE(int lva, int index, String pw, String matrNr) {
		try {
			System.out.print("Fuege der Gruppe ein Mitglied hinzu ( " + lva + ", " + index + ", " + pw + ", " + matrNr);
			getUE(lva).getGroup(index).addParticipant(pw, matrNr);
			System.out.print(" [erfolg]\n");
		} catch (InsufficientPermissionsException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
	}
	
	public static void setGradeGroup(int lva, int index, String matrNr, int grade, String pw) {
		try {
			System.out.print("Setze Note ( " + lva + ", " + index + ", " + matrNr + ", " + grade + ", " + pw + "): ...");
			getUE(lva).getGroup(index).setGrade(matrNr, grade, pw);
			System.out.print(" [erfolg]\n");
		} catch (InsufficientPermissionsException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		} catch (InvalidGradeException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
	}
	
	public static void kill(int lva, String pw) {
		try {
			System.out.print("Toete LVA ( " + lva + ", " + pw + "): ...");
			LVAManager.getLVA(lva).kill(pw);
			System.out.print(" [erfolg]\n");
		} catch (InsufficientPermissionsException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
	}
	
	public static void revive(int lva, String pw) {
		try {
			System.out.print("Stelle LVA wieder her ( " + lva + ", " + pw + "): ...");
			LVAManager.getLVA(lva).revive(pw);
			System.out.print(" [erfolg]\n");
		} catch (InsufficientPermissionsException e) {
			System.out.print(" [fehler]\n");
			System.out.print("\t" + e + "\n");
		}
	}
}